package com.atguigu.lease.common.Exceptions;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

/**
 * @Author zy
 * @Date 2024/12/11
 * @Desc
 * @Version 1.0
 */
@Data
public class LeaseException extends RuntimeException {
    private int code;

    public LeaseException(String message) {
        super(message);
    }

    public LeaseException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code=resultCodeEnum.getCode();
    }

    public LeaseException(int code, String message) {
        super(message);
        this.code = code;
    }
}
